﻿using FluentNHibernate.Mapping;
using Shake.Domain.Emuns;
using Shake.Domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shake.Domain.Maps
{
    public class UserMap : ClassMap<User>
    {
        public UserMap()
        {
            this.Table("UserInfo");
            this.Id(t => t.Id).Column("Id").Length(32).Not.Nullable();
            this.Map(t => t.Name).Column("Name").Not.Nullable();
            this.Map(t => t.Number).Column("Number").Not.Nullable();

            this.Map(t => t.BirthDay).Column("BirthDay").Not.Nullable();

            this.Map(t => t.Phone).Column("Phone").Not.Nullable();
            this.Map(t => t.Sex).Column("Sex").Length(32).Not.Nullable().CustomType<GenericEnumMapper<Sex>>();

            this.Map(t => t.DepartmentId).Column("DepartmentId").Not.Nullable();
            this.Map(t => t.PositionId).Column("PositionId").Not.Nullable();

            
        }
    }
}
